package com.antis.olsl.base.response;

import java.io.Serializable;

/**
 * Created by qi.yang on 2018/3/7.
 */
public class BaseResp implements Serializable {

    /**
     * 请求状态
     * 200	成功
     * 300	失败
     * 1001	接口认证失败
     * 1002	授权过期
     * 1003	缺失参数
     */
    public int code = -1;
    private String describle;
    private String merchantId;
    private String userId;
    private String token;

    public String getToken() {
        return token;
    }

    public void setToken(String token) {
        this.token = token;
    }

    public String getMerchantId() {
        return merchantId;
    }

    public void setMerchantId(String merchantId) {
        this.merchantId = merchantId;
    }

    public String getUserId() {
        return userId;
    }

    public void setUserId(String userId) {
        this.userId = userId;
    }

    public int getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }

    public boolean isOk() {
        return code == 200;
    }

    public boolean isTimeOut() {
        return code == 408 || code == 504;
    }

    public boolean isSlowNetwork() {
        return code == 500;
    }

    public boolean isUnauthorized() {
        return code == 401;
    }

    public String getDescrible() {
        return describle;
    }

    public void setDescrible(String describle) {
        this.describle = describle;
    }

}
